import json


class Response:
    def __init__(self, code, msg, data):
        self.code = code
        self.msg = msg
        self.data = data

    def __repr__(self):
        return f'<Response {self.code}: {self.msg}>'


def response2dict(self):
    return {
        'code': self.code,
        'msg': self.msg,
        'data': self.data
    }

